Skip to content

Declare ContainerRuntime class as implementing interfaces it already implements #24147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2025

Conversation

markfields
Copy link
Member

Description

We've hidden the fact that ContainerRuntime class implements certain interfaces to reduce exposure while ContainerRuntime was not internal. Now that it is, we can declare that it implements these interfaces.

It makes the code clearer, and code navigation works better.

@Copilot Copilot AI review requested due to automatic review settings March 25, 2025 17:58
@github-actions github-actions bot added the area: runtime Runtime related issues label Mar 25, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the ContainerRuntime class explicitly declare the interfaces it already implements, which improves code clarity and navigation.

  • Added explicit implementation for IFluidParentContext and IGarbageCollectionRuntime.
  • Updated import statements to support the new interfaces.
Comments suppressed due to low confidence (2)

packages/runtime/container-runtime/src/containerRuntime.ts:717

  • Verify that all required members of IGarbageCollectionRuntime are correctly implemented in ContainerRuntime to ensure full interface compliance.
IGarbageCollectionRuntime,

packages/runtime/container-runtime/src/containerRuntime.ts:720

  • Confirm that ContainerRuntime fully implements all expected members of IFluidParentContext, aligning with its interface definition.
IFluidParentContext,

@github-actions github-actions bot added the base: main PRs targeted against main branch label Mar 25, 2025
ISummarizerRuntime,
ISummarizerInternalsProvider,
IFluidParentContext,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agarwal-navin or @vladsud do you know why this wasn't here before? It's legacy-alpha so it wasn't about over-exposure.

For your reference, the spot where CR is passed as this interface is this line in its constructor:

const parentContext = wrapContext(this);

Copy link
Contributor

@agarwal-navin agarwal-navin Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFluidParentContext is ideally for contexts. For example, data store context implements it. ContainerRuntime acts as both the runtime and the context for that layer which makes it cumbersome and it has to implement the properties of IFluidParentContext.

The runtime part (IFluidDataStoreChannel) is handled by ChannelCollection. So, it seems fine that the context part is implemented by the ContainerRuntime directly. I don't know why it doesn't do it already, maybe because the legacy-alpha tagging happened after IFluidParentContext was introduced.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladsud do you know why? Any concerns telling TypeScript about this link?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this is reformulated in #24319

Copy link
Contributor

@agarwal-navin agarwal-navin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I would check with Vlad if there is any specific reason to not implement IFluidParentContext

@markfields
Copy link
Member Author

@vladsud any concerns?

@markfields markfields merged commit 689bbcd into microsoft:main Apr 17, 2025
39 checks passed
@markfields markfields deleted the cr/interfaces branch April 17, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: runtime Runtime related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants